﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Flux_Balance_Analysis
{
    /// <summary>
    /// Logica di interazione per ConstraintsWindow.xaml
    /// </summary>
    public partial class ConstraintsWindow : Window
    {
        public ConstraintsWindow()
        {
            InitializeComponent();
            this.mgr.ConstraintChanged += mgr_ConstraintChanged;
        }

        void mgr_ConstraintChanged(object sender, EventArgs e)
        {
            this.cmdCancel.IsEnabled = true;
            this.cmdConfirm.IsEnabled = true;
        }

        private void cmdConfirm_Click(object sender, RoutedEventArgs e)
        {
            this.mgr.CommitChange();
            this.cmdConfirm.IsEnabled = false;
            this.cmdCancel.IsEnabled = false;
        }

        private void cmdCancel_Click(object sender, RoutedEventArgs e)
        {
            this.mgr.Filter = "";
            this.cmdConfirm.IsEnabled = false;
            this.cmdCancel.IsEnabled = false;
        }
    }
}
